#!/usr/bin/env bash
# deepdive-initdb -- (DEPRECATED) Initializes the underlying database for the DeepDive application
# > deepdive initdb
# Initializes the whole database configured for the DeepDive application.
#
# > deepdive initdb RELATION...
# Initializes only the given RELATIONs.
##
set -eu

if [[ $# -eq 0 ]]; then
    # no arguments given, initialize the database as part of the app
    DEEPDIVE_PLAN_EDIT=false deepdive redo init/app
else
    # if a list of table names given, initialize corresponding tables
    for t; do
        deepdive create table "$t"
    done
fi
